<link rel="stylesheet" href="__CDN__/assets/element-ui-2.15.14/css/index.css">
<link href="/assets/css/sweetalert.css" rel="stylesheet">
<style>
    .el-form-item__label {
        width: 120px !important;
    }

    .el-tag + .el-tag {
        margin-left: 10px;
    }

    .button-new-tag {
        /*margin-left: 10px;*/
        height: 32px;
        line-height: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .input-new-tag {
        width: 90px;
        /*margin-left: 10px;*/
        vertical-align: bottom;
    }

    input[type="file"] {
        display: none !important;
    }

    .search-select .el-input--suffix .el-input__inner {
        width: 130px;
    }

    body {
        background: #fff !important;
    }

    .el-form-item__content {
        margin-left: 120px !important;
    }

    [v-cloak] {
        display: none !important;
    }

    .image {
        width: 100px;
        height: 100px;
        margin-top: 10px;
    }

    .image,.bg {
        width: 100px;
        height: 100px;
        margin-top: 10px;
    }

    .video {
        width: 480px;
        height: 280px;
    }

    .el-upload-list__item {
        position: relative;
    }

    .img-bg {
        position: absolute;
        bottom: 0;
        background: rgba(0, 0, 0, 0.75);
        height: 30px;
        width: 100%;
        line-height: 30px;
        text-align: center;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 6px;
    }
</style>
<div id="vue" data-id="{$id}" v-cloak>
    <el-form ref="form" role="form" :rules="rules" :model="formData" label-width="90px">
        <el-form-item label="标题：" prop="title">
            <el-input style="width: 330px;" placeholder="请您输入标题" maxlength="50" show-word-limit v-model="formData.title"></el-input>
        </el-form-item>
        <el-form-item label="视频封面：" prop="image">
            <el-button type="primary" plain size="small" @click="selectImage('image')" icon="el-icon-picture-outline">选择图片</el-button>
            <div>
                <a :href="formData.image" target="_blank">
                    <img v-if="formData.image" class="image" :src="formData.image">
                </a>
            </div>
            <span style="color: seagreen;">视频封面尺寸：155 * 100</span>
        </el-form-item>
        <el-form-item label="视频：" prop="video">
            <el-upload v-show="!formData.video" action="{:url('Upload/uploadVideo')}"
                       accept=".mp4,.avi,.flv,.wmv.rmvb,.mov"
                       :on-progress="handleUploadVideoProcess"
                       :on-success="handleVideoSuccess"
                       :before-upload="handleBeforeUploadVideo"
                       :show-file-list="false"
                       name="video"
                       list-type="picture-card"
            >
                <i v-if="!formData.video && videoUploadPercent == 0"
                   class="el-icon-plus avatar-uploader-icon"></i>
                <el-progress v-show="videoUploadPercent > 0"
                             type="circle"
                             :percentage="videoUploadPercent"
                             style="margin-top:7px;">
                </el-progress>
            </el-upload>
            <div class="video-box">
                <video v-show="formData.video"
                       :src="formData.video"
                       class="video"
                       controls="controls">
                    您的浏览器不支持视频播放
                </video>
                <div v-show="formData.video" class="video-btn">
                    <el-button size="small" @click="handleRemoveVideo" type="warning" plain icon="el-icon-remove">移除视频</el-button>
                </div>
            </div>
        </el-form-item>
        <el-form-item prop="desc" label="描述">
            <el-input
                    style="width: 330px;"
                    maxlength="200"
                    show-word-limit
                    type="textarea"
                    :rows="6"
                    placeholder="请您输入视频描述"
                    v-model="formData.desc"
            >
            </el-input>
        </el-form-item>
        <el-form-item label="详细内容">
<!--            <textarea id="v-content" style="width: 870px;height:370px;">{$content}</textarea>-->
            <textarea id="c-content" class="form-control editor" rows="5" name="row[content]"
                      cols="50">{$content}</textarea>
        </el-form-item>
        <el-form-item label="浏览量：" prop="views">
            <el-input style="width: 330px;" type="number" placeholder="浏览量" v-model="formData.views"></el-input>
        </el-form-item>
        <el-form-item label="播放量：" prop="play_num">
            <el-input style="width: 330px;" type="number" placeholder="播放量" v-model="formData.play_num"></el-input>
        </el-form-item>
        <el-form-item label="排序：" prop="sort">
            <el-input style="width: 330px;" type="number" placeholder="排序" v-model="formData.sort"></el-input>
        </el-form-item>
        <el-form-item label="状态：" prop="status">
            <el-radio style="margin-right: 0;" v-model="formData.status" label="1" border size="small">显示</el-radio>
            <el-radio v-model="formData.status" label="2" border size="small">隐藏</el-radio>
        </el-form-item>
        <el-divider></el-divider>
        <el-form-item>
            <el-button icon="el-icon-s-promotion" type="primary" @click="submit" size="small">提交</el-button>
            <el-button icon="el-icon-switch-button" plain @click="closeLayerDialog" size="small">关闭</el-button>
        </el-form-item>
    </el-form>
</div>

<script src="__CDN__/assets/element-ui-2.15.14/js/vue.js"></script>
<script src="__CDN__/assets/element-ui-2.15.14/js/index.js"></script>
<script src="__CDN__/assets/js/jquery-2.1.1.min.js"></script>
<script src="/assets/js/sweetalert.min.js"></script>
<!--<script>-->
<!--    var uploadUrl = '{:url("Upload/ueditorUpload")}'-->
<!--</script>-->
<!--<script src="__CDN__/assets/ueditor-plus/ueditor.config.js"></script>-->
<!--<script src="__CDN__/assets/ueditor-plus/third-party/zeroclipboard/ZeroClipboard.js"></script>-->
<!--<script src="__CDN__/assets/ueditor-plus/ueditor.all.js"></script>-->